﻿@using System.Configuration
@using MVCMongo.Services
@model IEnumerable<DataMongo.Entities.FeedPost>
@{
    ViewBag.Title = "Latest Feeds";
    var configUrl = ConfigurationManager.AppSettings["ImageLinkUrl"];
}
<ul>
    @foreach (var item in Model)
    {

        var imageUrl = configUrl + item.ImageURL1;
        <li>
            <div class="article-photo">
                <a href="@Url.RouteUrl("ViewFeed", new { id = item.FeedPostId, title = UtilityService.RemoveSpecialCharacters(item.Title) })" class="hover-effect" target="_blank"><img src="@imageUrl" width="59px" height="42px" alt="" /></a>
            </div>
            <div class="article-content">
                <h4><a href="@Url.RouteUrl("ViewFeed", new { id = item.FeedPostId, title = UtilityService.RemoveSpecialCharacters(item.Title) })" target="_blank">@item.Title</a><a class="h-comment" href="@Url.Action("FeedComment", "Home", new { feedId = item.FeedPostId})">@UtilityService.GetCommentCount(item.FeedPostId)</a></h4>
                <span class="meta">
                    <a href="@Url.RouteUrl("ViewFeed", new { id = item.FeedPostId, title = UtilityService.RemoveSpecialCharacters(item.Title) })" target="_blank"><span class="icon-text">&#128340;</span>@item.PublishDate.Substring(0, 16)</a>
                </span>
            </div>
        </li>
    }

</ul>
